this.BX=this.BX||{};(function(n,t){"use strict";class e{constructor(){var n=BX.Landing.Utils.isFunction;var t=BX.Landing.Utils.isString;var e=BX.Landing.Utils.isPlainObject;var i=BX.Landing.Utils.isArray;var s=BX.Landing.Utils.bind;var o=BX.Landing.Utils.proxy;var a=BX.Landing.Utils.data;this.node=options.node;this.manifest=e(options.manifest)?options.manifest:{};this.selector=t(options.selector)?options.selector:"";this.onChangeHandler=n(options.onChange)?options.onChange:function(){};this.onDesignShow=n(options.onDesignShow)?options.onDesignShow:function(){};this.changeOptionsHandler=n(options.onChangeOptions)?options.onChangeOptions:function(){};this.onDocumentClick=o(this.onDocumentClick,this);this.onDocumentKeydown=o(this.onDocumentKeydown,this);s(document,"click",this.onDocumentClick);s(document,"keydown",this.onDocumentKeydown);Object.freeze(this.manifest);this.node.dataset.selector=this.selector;if(this.isAllowInlineEdit()){this.onAllowInlineEdit()}}onDocumentClick(n){}onDocumentKeydown(n){if(n.keyCode===27){this.onEscapePress()}}onEscapePress(){}getField(){throw new Error("Must be implemented by subclass")}showEditor(){}hideEditor(){}onAllowInlineEdit(){}isAllowInlineEdit(){return this.manifest.allowInlineEdit!==false}isGrouped(){return typeof this.manifest.group==="string"&&this.manifest.group.length>0}setValue(n,t,e){throw new Error("Must be implemented by subclass")}getValue(){throw new Error("Must be implemented by subclass")}getAdditionalValue(){if(isPlainObject(this.manifest.extend)&&isArray(this.manifest.extend.attrs)){return this.manifest.extend.attrs.reduce(function(n,t){return n[t]=data(this.node,t),n}.bind(this),{})}return{}}onChange(){this.onChangeHandler.apply(null,[this])}getIndex(){var n=parseInt(this.selector.split("@")[1]);n=n===n?n:0;return n}preventSave(n){this.isSavePreventedValue=n}isSavePrevented(){return!!this.isSavePreventedValue}getBlock(){return BX.Landing.PageObject.getBlocks().getByChildNode(this.node)}}n.Node=e})(this.BX.Landing=this.BX.Landing||{},BX);
//# sourceMappingURL=node.bundle.map.js